package com.qf.personal.controller;

import com.qf.common.base.result.RespResult;
import com.qf.personal.entiy.Out;
import com.qf.personal.service.OutService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "外出")
@RestController
@RequestMapping("/my/out")
public class OutController {
    @Resource
    private OutService outService;

    @PutMapping("/add")
    @ApiOperation("新增申请")
    @ApiResponses({@ApiResponse(code = 200, message = "成功")})
    public RespResult<String> add(Out out, int mId, int eId, int tId) {
        return outService.add(out, mId, eId, tId);
    }

    @PutMapping("/delete")
    @ApiOperation("删除")
    @ApiResponses({@ApiResponse(code = 200, message = "成功")})
    public RespResult<String> delete(Long id) {
        return outService.deleteById(id);
    }
}
